package cn.tm05.dispose.request;

import cn.tm05.pojo.TreeNode;


/**
 * 请求主菜单处理类
 * @author TM05
 *
 */
public class MainMenuRequest {
	public java.util.List getTreeNodeList(String id,String name){
		//获得session
		javax.servlet.http.HttpSession session=cn.tm05.utils.GetWebSession.getSession();
		//获得用户角色
		String roleName=(String)session.getAttribute("roleName");
		//去掉空格
		roleName=roleName.trim();
		//新建节点队列
		java.util.List TreeNodeList=new java.util.ArrayList();
		if(roleName.equalsIgnoreCase("系统管理员")){
			if("root".equals(id)){
				TreeNode TreeNode=new TreeNode(id+1,"部门管理",false,null);
				TreeNodeList.add(TreeNode);

				TreeNode TreeNode2=new TreeNode(id+2,"系统维护",false,null);
				TreeNodeList.add(TreeNode2);
			}else if("root1".equals(id)){
				TreeNode TreeNode11=new TreeNode(id+11,"部门信息查询",true,"#");
				TreeNodeList.add(TreeNode11);
				TreeNode TreeNode12=new TreeNode(id+12,"部门计划查询",true,"#");
				TreeNodeList.add(TreeNode12);
				TreeNode TreeNode13=new TreeNode(id+13,"个人任务查询",true,"#");
				TreeNodeList.add(TreeNode13);
			}else if("root2".equals(id)){
				TreeNode TreeNode21=new TreeNode(id+21,"系统权限分配",true,"#");
				TreeNodeList.add(TreeNode21);
				TreeNode TreeNode22=new TreeNode(id+22,"系统用户管理",true,"#");
				TreeNodeList.add(TreeNode22);
				TreeNode TreeNode23=new TreeNode(id+23,"系统部门管理",true,"#");
				TreeNodeList.add(TreeNode23);
			}
			return TreeNodeList;
		}
		else if(roleName.equalsIgnoreCase("主管")){
			if("root".equals(id)){
				TreeNode TreeNode=new TreeNode(id+1,"计划处理",false,null);
				TreeNodeList.add(TreeNode);

				TreeNode TreeNode2=new TreeNode(id+2,"个人办公",false,null);
				TreeNodeList.add(TreeNode2);
				}else  if("root1".equals(id)){
					TreeNode TreeNode11=new TreeNode(id+11,"计划查询",true,"#");
					TreeNodeList.add(TreeNode11);
					TreeNode TreeNode12=new TreeNode(id+12,"计划提出",true,"#");
					TreeNodeList.add(TreeNode12);
				}else if("root2".equals(id)){
					TreeNode TreeNode21=new TreeNode(id+21,"个人任务查询",true,"#");
					TreeNodeList.add(TreeNode21);
					TreeNode TreeNode22=new TreeNode(id+22,"个人资料修改",true,"#");
					TreeNodeList.add(TreeNode22);
				}
			return TreeNodeList;
		}else if(roleName.equalsIgnoreCase("员工")){
			if("root".equals(id)){
				TreeNode TreeNode=new TreeNode(id+1,"个人办公",false,null);
				TreeNodeList.add(TreeNode);
				}else if("root1".equals(id)){
					TreeNode TreeNode11=new TreeNode(id+11,"个人任务查询",true,"#");
					TreeNodeList.add(TreeNode11);
					TreeNode TreeNode12=new TreeNode(id+12,"个人资料修改",true,"#");
					TreeNodeList.add(TreeNode12);
				}
			return TreeNodeList;
		}
		return TreeNodeList;
	}
}